package com.st.controller;

import com.st.entity.Result;
import com.st.entity.Ticket;
import com.st.service.ITicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("ticket1")
public class TicketController {
    @Autowired
    private ITicketService iTicketService;

    @RequestMapping("/findById")
    public Ticket findById(@RequestParam("attractionsId") Integer attractionsId){
        Ticket ticketByAid = iTicketService.getTicketByAid(attractionsId);
        return ticketByAid;
    }
    @RequestMapping("getTicketBy")
    public Ticket getTicketBy(Integer id){
        Ticket ticket = iTicketService.getTicketBy(id);
        return ticket;
    }
    @RequestMapping("delNum")
    public Result delNum(@RequestParam("delNum") String delNum){
        return iTicketService.delNum(delNum);
    }

}
